package org.hu.vhr.service;

import org.hu.vhr.mapper.DepartmentMapper;
import org.hu.vhr.model.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {
    @Autowired
    DepartmentMapper departmentMapper;
    public List<Department> getAllDepsByParentId(Integer parentsId) {
        return departmentMapper.getAllDepsByParentId(parentsId);
    }
    public List<Department> getAllDeps(){
        return departmentMapper.getAllDeps();
    }
    public void addDep(Department dep) {
        dep.setEnabled(true);
        departmentMapper.addDep(dep);
    }

    public void delDep(Department dep) {
        departmentMapper.delDep(dep);
    }
}
